cc.Class({
    extends: cc.Component,
    properties: {
        goldPrefab: cc.Prefab
    },
    onLoad: function () {
        this.goldList = [];
        for (var t = 0; t < 10; t++) {
            var e = cc.instantiate(this.goldPrefab);
            e.parent = this.node, e.active = !1, this.goldList.push(e);
        }
        this.node.active = !1;
    },
    moveAnimation: function (t, e) {
        this.node.active = !0;
        var n = this,
            o = 0,
            i = cc.callFunc(function () {
                n.goldList[o].getComponent("GoldAnim").showAnimation({
                    fromP: cc.v2(0, 0),
                    toP: cc.v2(150 * (Math.random() - .5), 2 * (Math.random() - .5) * 150 / 2),
                    duration: .2,
                    callback: function () {}.bind(this)
                }), o++;
            }, this),
            a = cc.sequence(i, cc.delayTime(.1)),
            s = cc.repeat(a, 10),
            c = 0,
            r = cc.callFunc(function () {
                n.goldList[c].getComponent("GoldAnim").moveAnimation({
                    toP: t,
                    duration: .2,
                    callback: function () {
                        e();
                    }.bind(this)
                }), c++;
            }, this),
            l = cc.sequence(r, cc.delayTime(.1)),
            d = cc.repeat(l, 10),
            h = cc.callFunc(function () {
                this.node.active = !1;
            }, this);
        l = cc.sequence(s, cc.delayTime(.3), d, cc.delayTime(.2), h);
        this.node.runAction(l);
    }
})